﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Pokerface.DataAcess
{
    public class Melangeur
    {
        /*public static Melangeur()
        {
            random = new Random();
        }*/

        public static DBO.Jeu melanger(DBO.Jeu jeu)
        {
            Random random = new Random();
            List<DBO.Carte> cartes = jeu.Cartes;

            for (int i = 0; i < cartes.Count; i++)
            {
                int nb = random.Next(0, cartes.Count);
                DBO.Carte tmp = cartes[nb];
                cartes[nb] = cartes[i];
                cartes[i] = tmp;
            }

            jeu.Cartes = cartes;

            return jeu;
        }
    }
}